<?php
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(dirname(__FILE__)));
require_once ( JPATH_BASE .'/includes/main_lib.php' );
require_once ( JPATH_BASE .'/includes/convert.php' );

$amount = $_POST['amount'];

$convert = new Convert;

# Convert 15 USD to GBP
if($_POST['from']!=$_POST['to']){
$result = $convert->convert($amount, $_POST['from'], $_POST['to']);
echo number_format($result, 2, ',', '.');
}else{
  echo $amount;
}
//echo '<br/>';

# Displays how much USD you need to get 100 INR - won't show the rounded value
//echo $convert->amountTo($amount, $_POST['to'],$_POST['from'], FALSE);
?>
